bpf: don't prune branches when a scalar is replaced with a pointer
authorJann Horn <jannh@google.com>
Tue, 19 Dec 2017 04:11:59 +0000 (20:11 -0800)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 22 Dec 2017 14:12:23 +0000 (14:12 +0000)
commite263a5d1653dc2af8cfcd40f8c2202870077a4ff
tree1963d23ca7f8372cd848860c5fb71cc51983229b
parentc4832039dcfbef771a8b58b79fa7254121192eb2
bpf: don't prune branches when a scalar is replaced with a pointer

This could be made safe by passing through a reference to env and checking
for env->allow_ptr_leaks, but it would only work one way and is probably
not worth the hassle - not doing it will not directly lead to program
rejection.

Fixes: f1174f77b50c ("bpf/verifier: rework value tracking")
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name bpf-don-t-prune-branches-when-a-scalar-is-replaced-w.patch
kernel/bpf/verifier.c